package mest.service.Modeling.Impl;

import com.alibaba.fastjson.JSON;
import mest.dao.Modeling.warehousesave_manytomany_recordDao;
import mest.entity.warehousesave_manytomany;
import mest.service.Modeling.warehousesave_manytomany_recordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class warehousesave_manytomany_recordServiceimpl implements warehousesave_manytomany_recordService {

    @Resource
    private warehousesave_manytomany_recordDao wmr;

    @Override
    public String insertModel(warehousesave_manytomany wsmtm, String theirDb,Integer userId) {
        /*/insertModel /delModel /updateByone*/
        System.out.println("进入增删改方法");
        Map<String, Object> returnmap = new HashMap<String, Object>();
        try {
            returnmap.put("code", 0);
            returnmap.put("msg", "操作成功");
            returnmap.put("count", wmr.insertModel(wsmtm,theirDb,userId));
        }catch (Exception e){
            returnmap.put("code", 1);
            returnmap.put("msg", "操作失败");
            e.toString();
        }    
        return JSON.toJSONString(returnmap);
    }
}
